package com.sangmo.fts.process.storage.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.storage.model.CsfWaybillItem;
import com.sangmo.fts.process.storage.repo.CsfWaybillItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CsfWaybillItemEntityService  extends BaseViewService<CsfWaybillItem> {

    @Autowired
    private CsfWaybillItemRepo csfWaybillItemRepo;

    @Override
    protected IDataViewRepo<CsfWaybillItem> getRepo() {
        return csfWaybillItemRepo;
    }

    public List<CsfWaybillItem> saveAll(List<CsfWaybillItem> waybillItems) {
        return csfWaybillItemRepo.saveAll(waybillItems);
    }

    public List<CsfWaybillItem> listByWaybillId(Long waybillId) {
        return csfWaybillItemRepo.findByWaybillId(waybillId);
    }
}
